/***************************************************************************
 *   temporary memory buffer test SDL_RWops test                           *
 *                                                                         *
 *   Copyright (C) 2004 by Tyler Montbriand                                *
 *   tsm@accesscomm.ca                                                     *
 *                                                                         *
 *   This program is free software; you can redistribute it and/or modify  *
 *   it under the terms of the GNU General Public License as published by  *
 *   the Free Software Foundation; either version 2 of the License, or     *
 *   (at your option) any later version.                                   *
 *                                                                         *
 *   This program is distributed in the hope that it will be useful,       *
 *   but WITHOUT ANY WARRANTY; without even the implied warranty of        *
 *   MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the         *
 *   GNU General Public License for more details.                          *
 *                                                                         *
 *   You should have received a copy of the GNU General Public License     *
 *   along with this program; if not, write to the                         *
 *   Free Software Foundation, Inc.,                                       *
 *   59 Temple Place - Suite 330, Boston, MA  02111-1307, USA.             *
 ***************************************************************************/

#include <stdio.h>
#include "SDL_rwtmp.h"
#include "SDL_rwfd.h"

int main(int argc, char *argv[])
{
  SDL_RWops *rw=SDL_RWTmp();
  if(rw==NULL)
  {
    fprintf(stderr,"couldn't create temporary buffer\n");
    return(1);
  }

  fprintf(stderr,"Reading from standard input!\n");

  while(SDL_RWTmp_glob(rw,rwin,1,2048)>0); // Read everything into buffer

  printf("Read %d bytes\n",SDL_RWseek(rw,0,SEEK_CUR));
  SDL_RWclose(rw);

  return(0);
}
